package com.huahua.myIdea.controller;

import com.huahua.myIdea.entity.GoodsDo;
import com.huahua.myIdea.service.NewGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class NewGoodsController {
    @Autowired
    private NewGoodsService newGoodsService;

    /**
     * 按id获取商品信息
     */
    @GetMapping("/goods/{name}")
    public GoodsDo getNewGoods(@PathVariable("name") String name) {
        return newGoodsService.findNewGoodsByName(name);
    }
}
